﻿/***************************************************************************
 创建者: 华磊
 开始时间: 2019.9.20
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) 姓名 2019.9.20 类的具体实现代码编写

 ***************************************************************************
 *  @file x.h
 *  功能:
 *
 *
 ***************************************************************************/
#ifndef MAPPATH_H
#define MAPPATH_H

#include "mappoint.h"
enum E_PATH_BARRIER_TYPE
{
    E_PATH_BARRIER_TYPE_NODETECT,
    E_PATH_BARRIER_TYPE_COMMON,
    E_PATH_BARRIER_TYPE_NARROW,
    E_PATH_BARRIER_TYPE_NARROW_A,
    E_PATH_BARRIER_TYPE_NARROW_B,
    E_PATH_BARRIER_TYPE_DONOTHING
};

class MapPath : public MapSpirit
{
public:
    enum Map_Path_Type{
        Map_Path_Type_Line = 0,
        Map_Path_Type_Quadratic_Bezier,
        Map_Path_Type_Cubic_Bezier,
        Map_Path_Type_Between_Floor,//楼层间线路
    };



    MapPath(int _id, std::string _name, int _start, int _end, Map_Path_Type _type, double _length,
            double _p1x = 0, double _p1y = 0, double _p2x=0, double _p2y = 0, bool _locked = false, double _speed = 0.3,
            double _p1x_real = 0, double _p1y_real = 0, double _p2x_real=0, double _p2y_real = 0);
    virtual ~MapPath();
    virtual MapSpirit *clone();
    MapPath(const MapPath &p) = delete;

    void setPathType(Map_Path_Type _path_type){path_type=_path_type;}
    void setStart(int _start){start = _start;}
	void setEnd(int _end) { end = _end; }
    void setP1x(double _p1x) { p1x = _p1x; }
    void setP1y(double _p1y) { p1y = _p1y; }
    void setP2x(double _p2x) { p2x = _p2x; }
    void setP2y(double _p2y) { p2y = _p2y; }

    void setP1x_real(double _p1x) { p1x_real = _p1x; }
    void setP1y_real(double _p1y) { p1y_real = _p1y; }
    void setP2x_real(double _p2x) { p2x_real = _p2x; }
    void setP2y_real(double _p2y) { p2y_real = _p2y; }

	void setLength(int _length) { length = _length; }
	void setLocked(bool _locked) { locked = _locked; }
    void setSpeed(double _speed) { speed = _speed; }
    void setBarrierType(E_PATH_BARRIER_TYPE typeIn){ barrierType = typeIn; }
    void setIsBackMove(bool isBackMoveIn){ isBackMove = isBackMoveIn; }

    int getStart() const {return start;}
    int getEnd() const {return end;}
    double getP1x() const {return p1x;}
    double getP1y() const {return p1y;}
    double getP2x() const {return p2x;}
    double getP2y() const {return p2y;}

    double getP1x_real() const {return p1x_real;}
    double getP1y_real() const {return p1y_real;}
    double getP2x_real() const {return p2x_real;}
    double getP2y_real() const {return p2y_real;}

    double getLength() const {return length;}
    bool getLocked() const {return locked;}
    double getSpeed() const {return speed;}
    E_PATH_BARRIER_TYPE getBarrierType () const {return barrierType;}
    bool getIsBackMove() const {return isBackMove;}

	Map_Path_Type getPathType() const { return path_type; }
private:
    Map_Path_Type path_type;
    int start;
    int end;
    double p1x;
    double p2x;
    double p1y;
    double p2y;
    double p1x_real;
    double p2x_real;
    double p1y_real;
    double p2y_real;
    double length;
    bool locked;
    double speed;

    E_PATH_BARRIER_TYPE barrierType;//壁障策略
    bool isBackMove;//退着运行
};

#endif // MAPPATH_H
